package com.example.demo;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestDemo {

    public static void main(String[] args) {
       // List<User> objectList = new ArrayList<>();
       // objectList.addAll(null);
       // System.out.println(objectList);
        boolean flag = true;
        System.out.println(String.valueOf(flag));
        Map<String,String> data = new HashMap<>();
        data.put("isPush",String.valueOf(flag));
        System.out.println(data.toString());
        String str = md5("13910310608");
        System.out.println(str);
        System.out.println(str.length());
    }

    public static String md5(String inStr) {
        inStr = inStr.replaceAll("\\s*", "");

        byte[] secretBytes = null;
        try {
            secretBytes = MessageDigest.getInstance("md5").digest(
                    inStr.getBytes());
        } catch (Exception e) {
            throw new RuntimeException("没有这个md5算法！");
        }

        String md5code = new BigInteger(1, secretBytes).toString(16);
        for (int i = 0; i < 32 - md5code.length(); i++) {
            md5code = "0" + md5code;
        }
        return md5code;
    }
}


